package com.lmf.springboot.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;

@Controller
public class MyController {
    @RequestMapping("/session")
    public String dosome(HttpServletRequest request, Model model,Integer id){
        request.getSession().setAttribute("msg","hello session");

        return "session";
    }
    @RequestMapping("/function")
    public String dosome2(Model model){
        model.addAttribute("msg","hello 李四");
        model.addAttribute("time",new Date());
        return "function";
    }
}
